//
//  DoubleExtensions.swift
//  SwiftWeather
//
//  Created by shen on 2023/8/28.
//

import Foundation

extension Double {
    var toRoundedInt: Int { Int(self.rounded()) }

    func convertToTemperature(in units: TemperatureUnits) -> Temperature {
        return Temperature(degrees: self.toRoundedInt, units: units)
    }
}
